export data with conditions